package com.szh.zh.fallback;

import com.szh.zh.feign.AccountClient;
import com.szh.zh.vo.DateVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;

import java.util.Date;
import java.util.List;


@Slf4j
public class AccountClientFallbackFactory implements FallbackFactory<AccountClient> {
    @Override
    public AccountClient create(Throwable cause) {
        return new AccountClient() {
            @Override
            public String testLoadBalancerCode() {
                log.error("myFeign-testLoadBalancerCode 出现异常");
                return "lalll";
            }

            @Override
            public void deduct(String userId, Integer money) {
                log.error("扣用户余额 失败");
            }

            @Override
            public DateVo testGetRequestBody(List<Long> longList) {
                return null;
            }

            @Override
            public String testJavaDate(Date date, String name) {
                return null;
            }

            @Override
            public String testHuToolDate(Date date, String name) {
                return null;
            }
        };
    }
}
